<?php

require_once dirname(__FILE__).'/../lib/vacationGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/vacationGeneratorHelper.class.php';

/**
 * vacation actions.
 *
 * @package    Amawal Invest
 * @subpackage vacation
 * @author     Ameen Shoman<amin.shoman@gmail.com>
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class vacationActions extends autoVacationActions
{
	public function executeListSubmitVacationType(sfWebRequest $req){
		$vac_types = $req->getParameter('vac_type');
		foreach ($vac_types as $trnas_id => $vac_type) {
			$trans = TransactionPeer::retrieveByPK($trnas_id);
			$trans->setVacationType($vac_type);
			$trans->save();
		}
		$approve_flags = $req->getParameter('approve_flag');
		foreach ($approve_flags as $trnas_id => $approve_flag) {
			$trans = TransactionPeer::retrieveByPK($trnas_id);
			$trans->setApproveFlag($approve_flag);
			$trans->save();
		}

		return $this->renderText(__('Done !'));
	}
}
